﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />


<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ihg-theme-draft">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <div class="container-fluid ihg-container">
  
    <div class="ihg-content-layout" style="margin-top: 0">
      <div class="col-sm-12">
        <div class="panel panel-default ihg-panel">
          <div class="panel-heading">
              <span class="panel-titles text-info" style="font-size: 13px;font-weight: bold;">
                <i class="glyphicon glyphicon-list" style="top: 2px;"></i>&nbsp;&nbsp;
                ALL ACTIVE SESSIONS
              </span>
          </div>
          <div class="panel-body" style="padding: 0px;">
            <table class="table table-striped ihg-table tab-pane" style="margin: 0px;">
              <thead>
                <tr>
                  <th>NAME</th>
                  <th>PARTICIPANTS</th>
                  <th>DATE</th>
                  <th>Administrator</th>
                  <th>PHASE</th>
                </tr>
              </thead>
              <tbody>
                <c:forEach var="activeSession" items="${activeSessions}">
                  <tr>
                    <td><a href="${ctx.host}/active-sessions/${activeSession.id}">${activeSession.name}</a></td>
                    <td>
                      <p>Assessor:&nbsp;${activeSession.assessorCount}</p>
                      <p>Delegate:&nbsp;${activeSession.delegateCount}</p>
                    </td>
                    <td><fmt:formatDate value="${activeSession.startDate}" pattern="yyyy-MM-dd"/>&nbsp;~&nbsp;<fmt:formatDate value="${activeSession.endDate}" pattern="yyyy-MM-dd"/></td>
                    <td>
                      <p style="text-align:left;">Administrator: ${activeSession.sessionHost.name}</p>
                      <p style="text-align:left;">Accessor Owner: ${activeSession.assessorOwner.name}</p>
                      <p style="text-align:left;">Delegate Owner: ${activeSession.delegateOwner.name}</p>
                    </td>
                    <td>
                      <a href="${ctx.host}/active-sessions/${activeSession.id}">
                        <label class="label label-${activeSession.sessionPhase.css}">${activeSession.sessionPhase.display}</label>
                      </a>
                    </td>
                  </tr>
                </c:forEach>
              </tbody>
            </table>
            
          </div>
        </div>
        <c:if test="${not empty historySessions}">
          <div class="panel panel-default ihg-panel">
            <div class="panel-heading">
                <span class="panel-titles text-info" style="font-size: 13px;font-weight: bold;">
                  <i class="glyphicon glyphicon-list" style="top: 2px;"></i>&nbsp;&nbsp;
                  ALL HISTORY SESSIONS
                </span>
            </div>
            <div class="panel-body" style="padding: 0px;">
              <table class="table table-striped ihg-table tab-pane" style="margin: 0px;">
                <thead>
                  <tr>
                    <th>NAME</th>
                    <th>PARTICIPANTS</th>
                    <th>DATE</th>
                    <th>Administrator</th>
                    <th>PHASE</th>
                  </tr>
                </thead>
                <tbody>
                  <c:forEach var="historySession" items="${historySessions}">
                    <tr>
                      <td><a href="javascript:void(0);">${historySession.name}</a></td>
                      <td>
                        <p>Assessor:&nbsp;${historySession.assessorCount}</p>
                        <p>Delegate:&nbsp;${historySession.delegateCount}</p>
                      </td>
                      <td><fmt:formatDate value="${historySession.startDate}" pattern="yyyy-MM-dd"/>&nbsp;~&nbsp;<fmt:formatDate value="${historySession.endDate}" pattern="yyyy-MM-dd"/></td>
                      <td>
                        <p style="text-align:left;">Administrator: ${historySession.sessionHost.name}</p>
                        <p style="text-align:left;">Accessor Owner: ${historySession.assessorOwner.name}</p>
                        <p style="text-align:left;">Delegate Owner: ${historySession.delegateOwner.name}</p>
                      </td>
                      <td>
                        <a href="javascript:void(0);">
                          <label class="label label-${historySession.sessionPhase.css}">${historySession.sessionPhase.display}</label>
                        </a>
                      </td>
                    </tr>
                  </c:forEach>
                </tbody>
              </table>
              
            </div>
          </div>
        </c:if>
      </div>
    
    </div>
  </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>

</body>
</html>